package com.io;

public class Test_1 {
    public static void main(String[] args) {
        BufferedReader_ bufferedReader_ = new BufferedReader_(new StringRead_());
        bufferedReader_.readFiles();
        BufferedReader_ bufferedReader_1 = new BufferedReader_(new FileRead_());
        bufferedReader_1.readFiles();



    }

}

class BufferedReader_ extends Reader_{
private Reader_ reader_;

    public BufferedReader_(Reader_ reader_) {
        this.reader_ = reader_;
    }

    @Override
    public void readFiles() {
        this.reader_.readFiles();
    }
}

abstract class Reader_{
    public abstract void readFiles();
}

class StringRead_ extends Reader_{

    @Override
    public void readFiles() {
        System.out.println("读字符串");
    }
}

class FileRead_ extends Reader_{

    @Override
    public void readFiles() {
        System.out.println("读文件");
    }
}